settingsManager = function() {
    var context = this;
    this.form = document.getElementById("settings-form");
    this.form.volume.value = localStorage.getItem("volume") || 0.8;
    this.form.show_target.checked = localStorage.getItem("show_target")!=null ? localStorage.getItem("show_target") == "true" : false;
    this.form.reloading.checked = localStorage.getItem("reloading")!=null ? localStorage.getItem("reloading") == "true" : true;
    this.form.volume.onchange = function() {
        localStorage.setItem("volume", this.form.volume.value);
    }
    this.form.show_target.onchange = function() {
        localStorage.setItem("show_target", this.form.show_target.checked);
    }
    this.form.reloading.onchange = function() {
        localStorage.setItem("reloading", this.form.reloading.checked);
    }
}
new settingsManager();